package com.pgybook.db.entity.mapper;

import org.springframework.stereotype.Repository;
import com.pgybook.db.entity.domain.WantedBookDailyAnalysis;
import com.pgybook.db.entity.domain.WantedBookDailyAnalysisEx;
import com.pgybook.db.entity.domain.WantedBookDailyAnalysisKey;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Repository
public interface WantedBookDailyAnalysisMapper {
    int countByExample(WantedBookDailyAnalysisEx example);

    int deleteByExample(WantedBookDailyAnalysisEx example);

    @Delete({
            "delete from wantedbookdailyanalysis",
            "where LIBID = #{libid,jdbcType=INTEGER}",
            "and BZDAY = #{bzday,jdbcType=DATE}",
            "and TYPE = #{type,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(WantedBookDailyAnalysisKey key);

    @Insert({
            "insert into wantedbookdailyanalysis (LIBID, BZDAY, ",
            "TYPE, BOOKTITLE, ",
            "NUM)",
            "values (#{libid,jdbcType=INTEGER}, #{bzday,jdbcType=DATE}, ",
            "#{type,jdbcType=INTEGER}, #{booktitle,jdbcType=VARCHAR}, ",
            "#{num,jdbcType=INTEGER})"
    })
    int insert(WantedBookDailyAnalysis record);

    int insertSelective(WantedBookDailyAnalysis record);

    List<WantedBookDailyAnalysis> selectByExample(WantedBookDailyAnalysisEx example);

    @Select({
            "select",
            "LIBID, BZDAY, TYPE, BOOKTITLE, NUM",
            "from wantedbookdailyanalysis",
            "where LIBID = #{libid,jdbcType=INTEGER}",
            "and BZDAY = #{bzday,jdbcType=DATE}",
            "and TYPE = #{type,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    WantedBookDailyAnalysis selectByPrimaryKey(WantedBookDailyAnalysisKey key);

    int updateByExampleSelective(@Param("record") WantedBookDailyAnalysis record, @Param("example") WantedBookDailyAnalysisEx example);

    int updateByExample(@Param("record") WantedBookDailyAnalysis record, @Param("example") WantedBookDailyAnalysisEx example);

    int updateByPrimaryKeySelective(WantedBookDailyAnalysis record);

    @Update({
            "update wantedbookdailyanalysis",
            "set BOOKTITLE = #{booktitle,jdbcType=VARCHAR},",
            "NUM = #{num,jdbcType=INTEGER}",
            "where LIBID = #{libid,jdbcType=INTEGER}",
            "and BZDAY = #{bzday,jdbcType=DATE}",
            "and TYPE = #{type,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(WantedBookDailyAnalysis record);
}
